<?php
/**
 * Created by PhpStorm.
 * User: Admin
 * Date: 2019/4/4
 * Time: 10:19
 */

namespace app\api\controller\v1;
use app\api\model\Category as CategoryModel;
use app\api\validate\CategoryException;

class Category
{
    public function getAllCategories()
    {
        $categories = CategoryModel::all([],'img');
        if(!$categories)
        {
            return new CategoryException();
        }
        return $categories;
    }
}